﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XNA_TD.Wellen
{
    public class Welle : IRunable
    {
        private int lvl;
        public Welle(int lvl)
            : base(Priority.Logic)
        {
            this.lvl = lvl;
        }

        public override void Load()
        {
            int zeit = 0;
            if (lvl >= 10 && ((int)(lvl * 1.2f)) % 4 == 0)
            {
                for (zeit = 0; zeit < 10; zeit++)
                {
                    Register(new TimedRegister(new Air(lvl), zeit * 1000));
                }
            }
            else
            {
                for (zeit = 0; zeit < 10; zeit++)
                {
                    Register(new TimedRegister(new Box(lvl), zeit * 1000));
                }
            }
            if (schwierigkeit != Schwierigkeit.Schwer)
            {
                zeit += 5;
            }
            zeit += 5;
            Register(new TimedRegister(new Welle(lvl + 1), zeit * 1000));
            UnRegister(this);
        }

        public override void UnLoad()
        {
        }
    }
}
